#include<stdio.h>
#include<stdlib.h>

#define FIFO_FIFE "sampleFIFO"

int main(int argc,char* argv[])
{
    FILE* fp;
    if(argc!=2)
    {
        printf("USAGE:fifoclient [string]\n");
        exit(1);
    }
    //打开有名管道
    if((fp=fopen(FIFO_FIFE,"w"))==NULL)
    {
        perror("fopen");
        exit(1);
    }
    //写入数据
    fputs(argv[1],fp);
    fclose(fp);
    return 0;
}